Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stake Deposit w/ Delegation Implementation #5

Merged
merged 5 commits into from
Dec 20, 2023
Merged

Conversation

apbendi
Copy link
Collaborator

@apbendi apbendi commented Dec 11, 2023

This PR sets up the UniStake contract and begins the implementation of the stake method. Specifically, it allows a user to call stake defining an amount and a delegatee who should receive the depositor's voting weight. The contract conditionally deploys a surrogate contract for the delegatee and transfers the tokens to it.

Intentionally left out of this PR—for the sake of keeping it small and reviewable—is virtually all other mechanics associated with staking, including:

  • Internal accounting for the staked tokens
  • Internal accounting about accruing rewards
  • The ability to withdrawal staked tokens

All of this functionality will be implemented in subsequent PRs.

@apbendi apbendi requested review from alexkeating and wildmolasses and removed request for alexkeating December 11, 2023 20:21
Copy link
Collaborator

@alexkeating alexkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, small comments

src/UniStaker.sol Show resolved Hide resolved
src/UniStaker.sol Show resolved Hide resolved
test/UniStaker.t.sol Show resolved Hide resolved
test/UniStaker.t.sol Show resolved Hide resolved
test/UniStaker.t.sol Show resolved Hide resolved
Copy link
Collaborator

@alexkeating alexkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! I clarified 1 comment

Copy link
Collaborator

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great Ben, found 1 or 2 small things

test/UniStaker.t.sol Show resolved Hide resolved
test/UniStaker.t.sol Outdated Show resolved Hide resolved
Copy link

Coverage after merging stake-delegation into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   UniStaker.sol92.31%50%100%100%37

@apbendi apbendi merged commit 02b5b71 into main Dec 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants